<?php

namespace app\db\conditions;

use yii\db\conditions\ConditionInterface;

class JsonCondition implements ConditionInterface
{
    private $column;
    private $values;
    private $operator;

    public function getColumn()
    {
        return $this->column;
    }

    public function getValues()
    {
        return $this->values;
    }

    public function getOperator()
    {
        return $this->operator;
    }

    public function __construct($operator, $column, array $values)
    {
        $this->operator = $operator;
        $this->column = $column;
        $this->values = $values;
    }

    public static function fromArrayDefinition($operator, $operands)
    {
        return new static($operator, $operands[0], $operands[1]);
    }
}
